import React, { Component } from 'react'
import HelloWorld from './HelloWorld'
export class App extends Component {
    constructor(){
        super()
        this.state={
            isShow:true
        }
    }
    switchShow(){
        this.setState({
            isShow: !this.state.isShow
        })
    }
  render() {
    const {isShow} = this.state
    return (
      <div>App
        { isShow&&<HelloWorld />}
        <button onClick={e=>this.switchShow()}>切换</button>
        {/* <HelloWorld /> */}
        
      </div>
    )
  }

}

export default App